%h1.album New Album
%table.album
  - form_for @album, albums_url, :method => :put do |form|
    %tr
      %td.field_title Name:
      %td.field= form.text_field     :name
      %td.error= error_message_on    :album, :name
    %tr
      %td.field_title Year:
      %td.field= form.text_field     :year
      %td.error= error_message_on    :album, :year
    %tr
      %td.field_title Artwork:
      %td.check_box_fields
        - @artworks.each do |artwork|
          %table.artwork_thumb
            %tr
              %td.artwork_thumb
                %a{:href => artwork_url(artwork)}
                  %img.artwork_thumb{:src => artwork.public_filename(:thumb), :title => artwork.filename, :alt => artwork.filename}
            %tr
              %td.check_box= check_box_tag("album[artwork_id]", artwork.id)
        or add
        %a{:href => new_artwork_url}new one
    %tr
      %td.submit= submit_tag 'Create'